class Solution {
    public:
        int findSpecialInteger(vector<int>& arr) {
            int a = 0, b = 0, n = arr.size();
            while (n--) {
                if (arr[n] == a) {
                    b++;
                } else {
                    a = arr[n];
                    b = 1;
                }
                if (b * 4 > arr.size()) {
                    return a;
                }
            }
            return -1;
        }
    };